package com.ruoyi.cloudpc.service.impl;

import com.ruoyi.cloudpc.domain.CloudIntegration;
import com.ruoyi.cloudpc.mapper.CloudIntegrationMapper;
import com.ruoyi.cloudpc.service.ICloudIntegrationService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 积分Service业务层处理
 *
 * @author Ten
 * @date 2025-09-13
 */
@Service
public class CloudIntegrationServiceImpl implements ICloudIntegrationService {
    @Autowired
    private CloudIntegrationMapper cloudIntegrationMapper;

    /**
     * 查询积分
     *
     * @param id 积分主键
     * @return 积分
     */
    @Override
    public CloudIntegration selectCloudIntegrationById(Long id) {
        return cloudIntegrationMapper.selectCloudIntegrationById(id);
    }

    /**
     * 查询积分列表
     *
     * @param cloudIntegration 积分
     * @return 积分
     */
    @Override
    public List<CloudIntegration> selectCloudIntegrationList(CloudIntegration cloudIntegration) {
        return cloudIntegrationMapper.selectCloudIntegrationList(cloudIntegration);
    }

    /**
     * 新增积分
     *
     * @param cloudIntegration 积分
     * @return 结果
     */
    @Override
    public int insertCloudIntegration(CloudIntegration cloudIntegration) {
        cloudIntegration.setCreateByAndTime();
        return cloudIntegrationMapper.insertCloudIntegration(cloudIntegration);
    }

    /**
     * 修改积分
     *
     * @param cloudIntegration 积分
     * @return 结果
     */
    @Override
    public int updateCloudIntegration(CloudIntegration cloudIntegration) {
        cloudIntegration.setUpdateByAndTime();
        return cloudIntegrationMapper.updateCloudIntegration(cloudIntegration);
    }

    /**
     * 批量删除积分
     *
     * @param ids 需要删除的积分主键
     * @return 结果
     */
    @Override
    public int deleteCloudIntegrationByIds(Long[] ids) {
        return cloudIntegrationMapper.deleteCloudIntegrationByIds(ids);
    }

    /**
     * 删除积分信息
     *
     * @param id 积分主键
     * @return 结果
     */
    @Override
    public int deleteCloudIntegrationById(Long id) {
        return cloudIntegrationMapper.deleteCloudIntegrationById(id);
    }
}
